import { ElMessage } from 'element-plus';
import { HttpRequestOptions, HttpRequestBase } from "./httpRequest";

// Http请求
class UnAuthorizationHttpRequest extends HttpRequestBase {
    constructor() {
        const options = new HttpRequestOptions();
        const config = options.getConfig();
        config.language = {
            defaultLanguage: "zh-cn"
        };
        config.errorAlert = (error: string) => {
            ElMessage({
                showClose: true,
                message: error,
                type: 'error'
            });
        };
        super(config);
    }
}
export const unAuthorizationHttpRequest = new UnAuthorizationHttpRequest();